﻿using RAP.Framework.Libary.DataSource.Model.Attribute;
using RAP.Framework.Libary.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace RAP.Web.Core.Server.Model.Test
{
    /// <summary>
    /// 学生实体
    /// </summary>
    public class Student : NamedDataModel
    {
        public string CourseNames { get; set; }

        [Lazyload]
        public virtual async Task<IList<Course>> GetCourses ( IList<Course> value = null )
        {
            this.CourseNames = value.Join<Course>( ",", ( course, idx ) =>
            {
                return course.Name;
            } );
            return await Task.FromResult( value );
        }
    }
}
